/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.yogi.webframework.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Yogi
 */
@Embeddable
public class OrdoDetailPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "T_ORDER_ID")
    private int tOrderId;
    @Basic(optional = false)
    @Column(name = "T_MATERIALS_ID")
    private int tMaterialsId;
    @Basic(optional = false)
    @Column(name = "T_PRODUCT_PART_NUM")
    private int tProductPartNum;

    public OrdoDetailPK() {
    }

    public OrdoDetailPK(int tOrderId, int tMaterialsId, int tProductPartNum) {
        this.tOrderId = tOrderId;
        this.tMaterialsId = tMaterialsId;
        this.tProductPartNum = tProductPartNum;
    }

    public int getTOrderId() {
        return tOrderId;
    }

    public void setTOrderId(int tOrderId) {
        this.tOrderId = tOrderId;
    }

    public int getTMaterialsId() {
        return tMaterialsId;
    }

    public void setTMaterialsId(int tMaterialsId) {
        this.tMaterialsId = tMaterialsId;
    }

    public int getTProductPartNum() {
        return tProductPartNum;
    }

    public void setTProductPartNum(int tProductPartNum) {
        this.tProductPartNum = tProductPartNum;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) tOrderId;
        hash += (int) tMaterialsId;
        hash += (int) tProductPartNum;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrdoDetailPK)) {
            return false;
        }
        OrdoDetailPK other = (OrdoDetailPK) object;
        if (this.tOrderId != other.tOrderId) {
            return false;
        }
        if (this.tMaterialsId != other.tMaterialsId) {
            return false;
        }
        if (this.tProductPartNum != other.tProductPartNum) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.yogi.webframework.model.OrdoDetailPK[tOrderId=" + tOrderId + ", tMaterialsId=" + tMaterialsId + ", tProductPartNum=" + tProductPartNum + "]";
    }

}
